package com.x.epspace.common;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jconfig.Configuration;
import org.jconfig.ConfigurationManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class AppConfig {
	 
	private static Logger log = LoggerFactory.getLogger(AppConfig.class);
	
	private static Configuration configuration = null;
	
	private AppConfig(){}
	
	public static Configuration getInstance(){
		if(configuration==null) {
			configuration = ConfigurationManager.getConfiguration("epspace");
		}
		return configuration;
	}
	
	public static String getProperty(String arg0,String arg1,String arg2){
		return AppConfig.getInstance().getProperty(arg0, arg1, arg2);
	}
	
	public static String getProperty(String arg0){
		return AppConfig.getInstance().getProperty(arg0);
	}
	
	public static String getProperty(String arg0,String arg1){
		return AppConfig.getInstance().getProperty(arg0,"", arg1);
	}
	
	public static void main(String[] args) {
		log.debug(AppConfig.getProperty("mainprom","Resp_Promte"));
		Pattern pattern = Pattern.compile(".*信.*息.*查.*询.*");
		Matcher matcher = pattern.matcher("信  啊息查询");
		boolean b= matcher.matches();
		System.out.println(b);
		String str = "信  啊NN息查询";
		System.out.println(str.replace("N", String.valueOf((char)10)));
	}
	
}
